package com.tx.springboot_demo.controller;

import com.tx.springboot_demo.domain.ApplicationProperty;
import com.tx.springboot_demo.domain.MercuryProperty;
import com.tx.springboot_demo.service.IConnectionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：tx
 * @description：
 * @date ：Created in 2019/4/3 15:14
 * @modified By：
 * @version:
 */
@RestController
public class HelloControlelr {

    @Autowired
    ApplicationProperty applicationProperty;

    @Autowired
    MercuryProperty mercuryProperty;

    @Autowired
    IConnectionService iConnectionService;

    @Value("${mercury.name}")
    private String name;

    @Value("${password}")
    private String password;

    @RequestMapping("/hello")
    public String hello(){
        return "hello world";
    }

    @RequestMapping("/helloindex")
    public String helloIndex(){
        System.out.println(name);
        System.out.println(applicationProperty.getWantSay());
        System.out.println(mercuryProperty.getName());
        System.out.println(password);
        iConnectionService.configure();
        return "index.index";
    }
}
